/**
 * 作者：陈文斌 on 2019/1/26.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';
import 'package:crm/view/AppBar/custom_app_bar.dart';
import 'package:crm/component/PainPoint/pain_point_record_list_section.dart';
import 'package:crm/page/PainPoint/add_pain_point_record_page.dart';

const String Title = '客户痛点记录';

class PainPointRecordPage extends StatefulWidget {
  final String customerId;

  PainPointRecordPage({
    Key key,
    this.customerId,
  }) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return _PainPointRecordPageState();
  }
}

class _PainPointRecordPageState extends State<PainPointRecordPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        title: Title,
        actions: <Widget>[
          MaterialButton(
            onPressed: () {
              print('添加');
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => AddPainPointRecordPage(),
                ),
              );
            },
            child: Text(
              '添加',
              style: AppStyles.actionsTitleStyle,
            ),
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
          ),
        ],
      ),
      body: PainPointRecordListSection(
        customerId: widget.customerId,
      ),
    );
  }
}
